package com.aishua.andpaydemo.fragment.caifufragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.aishua.andpaydemo.ImageloaderHelper;
import com.aishua.andpaydemo.R;
import com.aishua.andpaydemo.fragment.BaseFragment;

/**
 * Created by aishua on 2018/5/16.
 */

public class LicaiFragment extends BaseFragment {

    private TextView tv_zonzichan;
    private TextView tv_zuorishoyi;
    private ImageView img_jingtonglicai;
    private ImageView img_jijin;
    private ImageView img_jinxuancaiuhao;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        super.onCreateView(inflater,container,savedInstanceState);
        View view = View.inflate(getContext(), R.layout.fragment_licai,null);
        initTitleView(view);
        initViewData();
        initView(view);
        return view;

    }

    private void initView(View view) {

        img_jingtonglicai = view.findViewById(R.id.img_jingtonglicai);
        ImageloaderHelper.dispalyImage(mContext,R.drawable.jingronglicai,img_jingtonglicai);
        img_jijin =view.findViewById(R.id.img_jijin);
        ImageloaderHelper.dispalyImage(mContext,R.drawable.jijin,img_jijin);
        img_jinxuancaiuhao =view.findViewById(R.id.img_jinxuancaiuhao);
        ImageloaderHelper.dispalyImage(mContext,R.drawable.jinxuancaiuhao,img_jinxuancaiuhao);

    }


    private void initTitleView(View view) {

        tv_zonzichan =view.findViewById(R.id.tv_zonzichan);
        tv_zuorishoyi =view.findViewById(R.id.tv_zuorishoyi);

    }

    private void initViewData() {

        String str="总资产：（元）"+"\n"+"12345.67";
        tv_zonzichan.setTextSize(18);
//        tv_zonzichan.setText(Html.fromHtml(str));
        tv_zonzichan.setText(str);
        String str1="昨日收益：（元）"+"\n"+"345.67";
        tv_zuorishoyi.setTextSize(18);
//        tv_zonzichan.setText(Html.fromHtml(str1));
        tv_zuorishoyi.setText(str1);
    }



}
